package com.ruoyi.btlfbreed.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.btlfbreed.mapper.TbMedicineRecordsMapper;
import com.ruoyi.btlfbreed.domain.TbMedicineRecords;
import com.ruoyi.btlfbreed.service.ITbMedicineRecordsService;

/**
 * 药品使用登记Service业务层处理
 * 
 * @author codeman
 * @date 2024-05-07
 */
@Service
public class TbMedicineRecordsServiceImpl implements ITbMedicineRecordsService 
{
    @Autowired
    private TbMedicineRecordsMapper tbMedicineRecordsMapper;

    /**
     * 查询药品使用登记
     * 
     * @param recordId 药品使用登记主键
     * @return 药品使用登记
     */
    @Override
    public TbMedicineRecords selectTbMedicineRecordsByRecordId(Long recordId)
    {
        return tbMedicineRecordsMapper.selectTbMedicineRecordsByRecordId(recordId);
    }

    /**
     * 查询药品使用登记列表
     * 
     * @param tbMedicineRecords 药品使用登记
     * @return 药品使用登记
     */
    @Override
    public List<TbMedicineRecords> selectTbMedicineRecordsList(TbMedicineRecords tbMedicineRecords)
    {
        return tbMedicineRecordsMapper.selectTbMedicineRecordsList(tbMedicineRecords);
    }

    /**
     * 新增药品使用登记
     * 
     * @param tbMedicineRecords 药品使用登记
     * @return 结果
     */
    @Override
    public int insertTbMedicineRecords(TbMedicineRecords tbMedicineRecords)
    {
        tbMedicineRecords.setCreateTime(DateUtils.getNowDate());
        return tbMedicineRecordsMapper.insertTbMedicineRecords(tbMedicineRecords);
    }

    /**
     * 修改药品使用登记
     * 
     * @param tbMedicineRecords 药品使用登记
     * @return 结果
     */
    @Override
    public int updateTbMedicineRecords(TbMedicineRecords tbMedicineRecords)
    {
        tbMedicineRecords.setUpdateTime(DateUtils.getNowDate());
        return tbMedicineRecordsMapper.updateTbMedicineRecords(tbMedicineRecords);
    }

    /**
     * 批量删除药品使用登记
     * 
     * @param recordIds 需要删除的药品使用登记主键
     * @return 结果
     */
    @Override
    public int deleteTbMedicineRecordsByRecordIds(Long[] recordIds)
    {
        return tbMedicineRecordsMapper.deleteTbMedicineRecordsByRecordIds(recordIds);
    }

    /**
     * 删除药品使用登记信息
     * 
     * @param recordId 药品使用登记主键
     * @return 结果
     */
    @Override
    public int deleteTbMedicineRecordsByRecordId(Long recordId)
    {
        return tbMedicineRecordsMapper.deleteTbMedicineRecordsByRecordId(recordId);
    }
}
